package com.bawei.router.provider

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.bawei.base.RoutePath
import com.tencent.mmkv.MMKV

/**
 * Author: Jason Zhang
 * Date: 2024/12/16
 * Desc: 对外暴露服务，提供获取登录Token的方法实现
 */
@Route(path = RoutePath.PATH_TOKEN_PROVIDER)
class LoginTokenService: ITokenProvider {

    private lateinit var mContext: Context

    override fun init(context: Context?) {
        if (context != null) {
            mContext = context
        }
    }

    override fun getLoginToken(): String {
        var token = MMKV.defaultMMKV().decodeString("token", "")
        return token ?: "token@123"
    }


}